import request from '@/utils/request'

//查询客户应收账款流水列表
export function getReceivableList(query){
  return request({
    url:'/customer/receivableflow/list',
    method:'get',
    params:query
  })
}
// 查询客户管理列表
export function listCustomer(query) {
  return request({
    url: '/customer/customer/list',
    method: 'get',
    params: query
  })
}

// 查询客户管理详细
export function getCustomer(guid) {
  return request({
    url: '/customer/customer/' + guid,
    method: 'get'
  })
}

// 查询客户余额汇总额
export function getSumBalance(query) {
  return request({
    url: '/customer/customer/listAmountSum',
    method: 'get',
    params: query
  })
}

// 查询客户管理详细、包括预收款余额、在途订单
export function getCustomer2(data) {
  return request({
    url: '/customer/customer/prebalancedetail',
    method: 'get',
    params: data
  })
}

// 查询预收款
export function getCusCashflow(data) {
  return request({
    url: '/customer/cashflow/list',
    method: 'get',
    params: data
  })
}

// 新增客户管理
export function addCustomer(data) {
  return request({
    url: '/customer/customer',
    method: 'post',
    data: data
  })
}

// 修改客户管理
export function updateCustomer(data) {
  return request({
    url: '/customer/customer',
    method: 'put',
    data: data
  })
}

// 删除客户管理
export function delCustomer(guid) {
  return request({
    url: '/customer/customer/' + guid,
    method: 'delete'
  })
}

// 导出客户管理
export function exportCustomer(query) {
  return request({
    url: '/customer/customer/export',
    method: 'get',
    params: query
  })
}
